#!/bin/bash

set -e

export LIBICONV_VERSION=1.71
export LIBICONV_INSTALL_HNP_PATH=${HNP_PUBLIC_PATH}/libiconv.org/libiconv_${LIBICONV_VERSION}

cd source
    sh configure \
	--prefix=${LIBICONV_INSTALL_HNP_PATH} \
	${HOST_TYPE}

    make -j(nproc)
    make install


cp hnp.json ${LIBICONV_INSTALL_HNP_PATH}/hnp.json
cd ${HNP_PUBLIC_PATH}/libiconv.org
	mkdir -p ${ARCHIVE_PATH}
	${HNP_TOOL} pack -i ${LIBICONV_INSTALL_HNP_PATH} -o ${ARCHIVE_PATH}
	tar -zvcf ${ARCHIVE_PATH}/libiconv_${LIBICONV_VERSION}.tar.gz libiconv_${LIBICONV_VERSION}/

